Historically, transport airplanes have generally been specifically designed to haul either cargo, passengers, or outsize cargo. Prior to and during World War II, cargo aircraft were primarily adaptations of passenger airplanes. Even today, most of the commercial cargo is carried on such adaptations or in the belly hold of passenger airplanes.
Military cargo aircraft, such as the C-130 and C-141, are designed to haul cargo and some vehicles --but not outsize cargo such as tanks or bridge launchers. The C-5A can carry all militarily defined outsize cargo and large commercial vehicles. Some later military cargo airplanes can carry some outsize vehicles/equipment, but the price is paid in terms of carrying a large fuselage around for the few times such outsize cargo is actually carried. Airlines may be called upon to serve as CRAF (Civil Reserve Air Fleet) in emergencies. However, being optimized for passenger service, they are generally poor cargo aircraft: the floor is too high off the ground, the doors are narrow, and it is difficult, if not impossible to carry large vehicles.
Passenger airliners also require a relatively long turnaround time at the termination of a specific flight. Many operations not pertinent to flight but necessary for the passenger cabin are performed. The cabin must be cleaned, sanitary facilities emptied, and supplies restocked. Meanwhile, the airplane could have been serviced and been made ready for flight in considerably less time. The point is that an airliner does not earn a return on its investment while sitting on the ground.
Thus, an ideal transport airplane is considered to be one which is designed to utilize one common airframe to carry passengers, cargo, and outsize equipment. While several possible configurational arrangements are perceivable, it has generally been true that the penalty for this versatility has been high acquisition and operation costs.